package com.itheima.controllect;

import java.util.Random;

public class Text {
    public static void main(String[] args) {
        Random ran = new Random();
        System.out.println("自动生成随机整数1--5");
        int sj = ran.nextInt(5) + 1;
        while (true) {
            int sj2 = ran.nextInt(5) + 1;
            if (sj == sj2) {
                break;
            } else {
                System.out.println("随机生成的是" + sj + "号和" + sj2 + "号");
                break;
            }
        }
    }
}
